package com.wujie.hello.spring.cloud.server.admin.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wujie
 * @version 1.0.0:
 * @title TestController
 * @Description TODO
 * @dateTime 2020/9/4 11:13
 * @Copyright 2020-2021
 */
@RestController
public class TestController {
    @Value("${server.port}")
    private String fromPort;

    @RequestMapping(value = "hi", method = RequestMethod.GET)
    public String sayHi(@RequestParam(value = "port") String port) {
        return String.format("Hi，your message is : %s i am from port : %s", port, fromPort);
    }
}
